<template>
	<view>
		<template>
			<view class="title">
				{{ (!isOrder ? item[$t('item.goods_name')] : item[$t('item.goods_name')]) || $t("暂无信息") }}
			</view>

			<view style="width: 100%;display: flex;">
				<view style="width: 70%;">
					<view class="lineP">
						<view style="flex: 1;">
							<view class="lineP">

								<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_weight')]+'kg'"
									color="#008aff">
								</Tag>
								<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_volume')]+'m³'"
									color="#ff7200">
								</Tag>

								<block v-if="!isOrder">
									<Tag v-if="item.whole_diffuse" class="u-margin-bottom-14"
										:text="item[$t('item.whole_diffuse')]" color="#18cee3"></Tag>
								</block>
								<block v-else>
									<Tag v-if="item.whole_diffuse&&item.whole_diffuse.value" class="u-margin-bottom-14"
										:text="$t(item.whole_diffuse.value)" color="#13b5b1"></Tag>
								</block>

							</view>
							<!-- <view>
								{{item.car_l + 'm*'  + item.car_w + 'm*'  + item.car_h + 'm' || ''}}
							</view> -->
							<view class="lineP u-margin-bottom-0">
								<FromToCountry :item="item"></FromToCountry>
							</view>
						</view>
					</view>

					<view class="address">
						<div class="icon">
							<image :src="HTTP_IMG_UTL+'tubiao1.png'" style="width:30rpx;height:30rpx" />
						</div>
						<div>
							<view class="label">{{$t("出发城市")}}</view>
							<view class="u-flex-1 value">
								{{item.hyd || $t("暂无信息") }}
							</view>
						</div>
					</view>
					<view class="address">
						<div class="icon">
							<image :src="HTTP_IMG_UTL+'tubiao2.png'" style="width:30rpx;height:30rpx" />
						</div>
						<view>
							<view class="label">{{$t("到达城市")}}</view>
							<view class="u-flex-1 value">
								{{item.shd || $t("暂无信息") }}
							</view>
						</view>
					</view>
				</view>

				<view style="width: 30%;">
					<view class="carPicture">
						<img :src="HTTP_IMG_UTL+'huowuPic.png'" alt="" />
					</view>
				</view>
			</view>

		</template>
	</view>
</template>

<script>
	import {
		createC2CConversation,
		isBase64,
		time
	} from "@/common/public";
	import FromToCountry from '@/components/FromToCountry.vue'

	import Tag from '@/components/Tag.vue'
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from "@/config/app";
	export default {
		components: {
			Tag,
			FromToCountry
		},
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String | Number,
				default: '1',
			},
			isOrder: {
				type: [Boolean, Number],
				default: false,
			}
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : IMAGE_URL + src
				}
			},
		},
		data() {
			return {
				HTTP_IMG_UTL
			};
		},
		methods: {
			time
		}
	}
</script>

<style lang="scss" scoped>
	.carPicture {
		margin-top: 100rpx;

		img {
			height: 160rpx;
			width: 180rpx;
		}
	}

	.lineP {
		display: flex;
		align-items: center;
		margin-bottom: 8px;
		position: relative;
		font-size: 16px;
		position: relative;
		flex-wrap: wrap;

		.tag {
			margin-top: 20rpx;
		}

		&.shot {
			width: 48%;
			flex-wrap: wrap;


		}



		.headline_img {
			width: 30rpx;
			height: 30rpx;
			margin-right: 10rpx;
		}

		.label {
			font-weight: 600;
			margin-bottom: 10rpx;

		}
	}

	.title {
		color: #000000;
		text-align: left;
		font-size: 38rpx;
		font-weight: 600;
		margin-top: 10rpx;
		word-break: break-all;
		margin-bottom: 20rpx;
	}

	.address {
		margin-bottom: 32rpx;
		font-size: 28rpx;
		position: relative;
		display: flex;
		// font-weight: 600;

		// .warp {
		// 	width: 55%;
		// }

		.headline_img {
			position: absolute;
			left: 0;
			top: 4rpx;
			width: 30rpx;
			height: 30rpx;
		}

		.label {
			font-weight: 600;
			margin-bottom: 4rpx;
			color: #3d3d3d;
			font-size: 24rpx;
		}
	}

	.bidding_time {
		width: 70%;
	}

	.icon {
		width: 60rpx;
		height: 60rpx;
		border-radius: 8rpx;
		background: #F5F4F9;
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
		margin-right: 16rpx;
	}

	.value {
		font-size: 22rpx;
		color: #3d3d3d;
	}
</style>